//
//  IHLRtcCallStatus.h
//  YueYue
//
//  Created by hulu001 on 2024/1/9.
//

#import <Foundation/Foundation.h>
#import "HLRtcCallKitConsts.h"

@class HLRtcCallKitContext;

@protocol IHLRtcCallStatus <NSObject>

/// 当前通话状态
@property (nonatomic, assign, readonly) HLRtcCallStatus callStatus;

/// 通话上下文
@property (nonatomic, strong) HLRtcCallKitContext * _Nullable context;

/// 创建频道（房间）
/// @param callType 类型：视频｜音频
/// @param completion 返回创建的频道（房间）ID
- (void)createChannel:(HLRtcCallType)callType
           completion:(nullable void(^)(NSString * _Nullable channelID, NSError * _Nullable error))completion;

/// 加入频道
/// @param channelID 频道（房间）ID
/// @param completion 加入结果
- (void)JoinChannel:(NSString *_Nonnull)channelID
         completion:(nullable void(^)(NSError * _Nullable error))completion;

/// 开始呼叫
/// @param userID 呼叫的用户ID
/// @param type 通话类型
/// @param completion 回调
- (void)call:(NSString *_Nonnull)userID
        type:(HLRtcCallType)type
        videoType:(HLRtcCallVideoType)videoType
  completion:(void(^_Nullable)(NSError * _Nullable error))completion;

/// 多人呼叫
/// @param userIDs  呼叫的用户ID数组 (不包含自己)
/// @param type 通话类型
/// @param completion 回调
- (void)groupCall:(NSArray<NSString *> *_Nonnull)userIDs
          groupID:(nullable NSString *)groupID
             type:(HLRtcCallType)type
       completion:(void(^_Nullable)(NSError * _Nullable error))completion;

/// 取消呼叫
/// @param completion 回调
- (void)cancel:(nullable void(^)(NSError * _Nullable error))completion;

/// 接受呼叫
/// @param completion 回调
//- (void)accept:(nullable void(^)(NSError * _Nullable error))completion;
- (void)accept:(void(^_Nullable)(NSError * _Nullable error))completion;

/// 拒绝呼叫
/// @param completion 回调
- (void)reject:(nullable void(^)(NSError * _Nullable error))completion;

/// 挂断
/// @param completion 回调
- (void)hangup:(nullable void(^)(NSError * _Nullable error))completion;

/// 离开，不挂断
/// @param completion 回调
- (void)leave:(nullable void(^)(NSError * _Nullable error))completion;

/// 在通话过程中切换通话类型。非通话过程中调用无效。仅支持1对1通话。
/// @param type 通话类型: 音频/视频
/// @param completion 切换完成的回调
- (void)switchCallType:(HLRtcCallType)type completion:(nullable void(^)(NSError * _Nullable error))completion;

@end
